package com.test.springboot.mybatis.entity.enums;

/**
 * 2018-08-08
 * 
 * @author chenxubing
 *
 */
public enum EnumRecordType {
    /**
     * 未知
     */
    UNKNOW((byte) 0, "未知"),
    /**
     * 付款
     */
    PAY((byte) 1, "付款"),
    /**
     * 退款
     */
    REFUND((byte) 2, "退款");
    
    private final byte    code;
    private final String intro;

    EnumRecordType(byte code, String intro) {
        this.code = code;
        this.intro = intro;
    }

    public byte getCode() {
        return code;
    }

    public String getIntro() {
        return intro;
    }

    public static EnumRecordType of(byte code) {
        for (EnumRecordType item : EnumRecordType.values()) {
            if (item.code == code) {
                return item;
            }
        }
        return UNKNOW;
    }

}
